updating oE absolute_path

absolute_path

include filesys.e 
namespace filesys 
public function absolute_path(sequence filename) 

determines if the supplied string is an absolute path or a relative path.

Parameters:
  1. filename : a sequence, the name of the file path
Returns:

An integer, 0 if filename is a relative path or 1 otherwise.

Comments:

A relative path is one which is relative to the current directory and an absolute path is one that doesn't need to know the current directory to find the file.

Example 1:
? absolute_path("") -- returns 0 
? absolute_path("/usr/bin/abc") -- returns 1 
? absolute_path("\\temp\\somefile.doc") -- returns 1 
? absolute_path("../abc") -- returns 0 
? absolute_path("local/abc.txt") -- returns 0 
? absolute_path("abc.txt") -- returns 0 
? absolute_path("c:..\\abc") -- returns 0 
 
-- The next two examples return  
-- 0 on Unix platforms and  
-- 1 on Microsoft platforms 
? absolute_path("c:\\windows\\system32\\abc") 
? absolute_path("c:/windows/system32/abc") 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu